package com.cq.hd.common.enums.biz;

import lombok.Getter;

/**
 * 经纪人入驻状态：状态(1-待入驻，2-入驻失败，3-待签约，4-签约成功，5-签约失败)
 */
public enum AgentEnterStateEnum {

    WAIT_ENTER(1, "待入驻"),
    ENTER_FAIL(2, "入驻失败"),
    WAIT_SIGN(3, "待签约"),
    SIGN_SUCCESS(4, "签约成功"),
    SIGN_FAIL(5, "签约失败"),
    ENTER_AUDIT(6, "入驻审核中"),
    ;

    @Getter
    private final Integer value;

    @Getter
    private final String name;

    AgentEnterStateEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    public static AgentEnterStateEnum typeOf(Integer value) {
        AgentEnterStateEnum[] values = AgentEnterStateEnum.values();
        for (AgentEnterStateEnum v : values) {
            if (v.value.equals(value)) {
                return v;
            }
        }
        return null;
    }

    public static AgentEnterStateEnum typeOf(String name) {
        AgentEnterStateEnum[] values = AgentEnterStateEnum.values();
        for (AgentEnterStateEnum v : values) {
            if (v.name.equals(name)) {
                return v;
            }
        }
        return null;
    }

}
